package com.x.erp.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.alibaba.dubbo.config.annotation.Service;
import com.x.erp.dao.CarAuthDao;
import com.x.erp.manage.CarAuthManage;
import com.x.erp.model.CarAuth;
import com.x.erp.rpc.CarAuthRpcService;
import com.x.framework.exception.BusinessException;
import com.x.framework.exception.ExceptionCode;
import com.x.framework.service.BaseService;
/**
 * 车辆认证信息服务
 */
@Component
@Service(interfaceName = "com.x.erp.rpc.CarAuthRpcService", timeout = 60000)
public class CarAuthService extends BaseService implements CarAuthRpcService {

	@Autowired
	private CarAuthDao carAuthDao;
	
	@Autowired
	private CarAuthManage carAuthManage;
	/**
	 *查询车辆认证证书信息
	 */
	@Override
	public CarAuth selectCarAuth(CarAuth carAuth) {
		try {
			return carAuthDao.selectCarAuth(carAuth);
		} catch (Exception e) {
			throw new BusinessException(ExceptionCode.EXCEPTION_CODE0000, e);
		}
	}
	/**
	 *插入车辆认证证书信息
	 */
	@Override
	public CarAuth insertCarAuth(CarAuth carAuth) {
		try {
			return carAuthManage.insertCarAuth(carAuth);
		} catch (Exception e) {
			throw new BusinessException(ExceptionCode.EXCEPTION_CODE0000, e);
		}
	}
}
